﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;

namespace Gamev1
{
    class HUD
    {
        private Character character;
        public Vector2 Position { get; set; }
        public Texture2D Texture { get; set; }

        public HUD(Character character)
        {
            this.character = character;
        }

        public void Update(GameTime gameTime)
        {
            Position = new Vector2(0, character.Position.Y - Game1.screenHeight + 210);
        }

        public void Draw(SpriteBatch spriteBatch, SpriteFont font)
        {
            spriteBatch.Draw(Texture, Position, new Color(0, 0, 0, 150));
            spriteBatch.DrawString(font, "Life " + (character.Health), new Vector2(Position.X + 20, Position.Y + 15), Color.Red);
            spriteBatch.DrawString(font, "Height " + Math.Round((470 - character.Position.Y) / 10), new Vector2(Position.X + 130, Position.Y + 15), Color.Red);
            spriteBatch.DrawString(font, "Time " + Math.Round(character.TimeLimit - (character.CurrentTime)), new Vector2(Position.X + 300, Position.Y + 15), Color.Red);
            spriteBatch.DrawString(font, "Score " + character.Score, new Vector2(Position.X + 900, Position.Y + 15), Color.Red);
            spriteBatch.DrawString(font, "Monsters killed " + character.monstersKilled, new Vector2(Position.X + 1080, Position.Y + 15), Color.Red);
            if (character.hasBonus)
            {
                spriteBatch.DrawString(font, "BonusTime " + Math.Round(character.BonusTime), new Vector2(Texture.Width / 2 - 100, Position.Y + 15), Color.Red);
            }
        }
    }
}
